package com.example.toutiao.view

import android.os.CountDownTimer
import com.example.toutiao.utils.CountDownListener

class AuthCodeTimer(
    millisInFuture: Long,
    countDownInterval: Long,
    mCountDownListener: CountDownListener
) : CountDownTimer(
    millisInFuture,
    countDownInterval
) {
    private val mCountDownListener:CountDownListener=mCountDownListener

    override fun onTick(millisUntilFinished: Long) {
        mCountDownListener.isOverTime(false)
        mCountDownListener.countDown(millisUntilFinished)
    }

    override fun onFinish() {
        mCountDownListener.isOverTime(true)
    }
}